\documentclass[10pt,a4paper]{article}
\newcommand\cn[1]{\texttt{\char92 #1}}
\title{Micro-Awk}
\begin{document}
\maketitle
\section*{Formal Grammar}
\begin{quote}
$PROGRAM\rightarrow BEGIN$ $SERIES$ $END$ \\
$SERIES\rightarrow EXP$ $SERIES \vert \epsilon$ \\
$BEGIN\rightarrow $BEGIN $ACTIONLIST \vert \epsilon$ \\
$ACTIONLIST \rightarrow \{ACTION\}$ \\
$ACTION \rightarrow COMMAND RESTACTION$ \\
$RESTACTION \rightarrow $;$ACTION\vert \epsilon$\\
$COMMAND \rightarrow SUBSTRING \vert REPLACE \vert INSERT \vert REMOVE \vert \\
PRINT \vert  WHILE \vert FOR$ \\
$END \rightarrow $END$ ACTIONLIST$ \\
$EXP \rightarrow RE ACTIONLIST$ \\
$RE \rightarrow L1 \vert \epsilon$ \\
$L1 \rightarrow (L)$ $ RESTL1 \vert CHARARG$ $RESTL1$\\
$L \rightarrow L1 \vert L1$ $L1TAIL \vert L1$ $L2TAIL$\\
$RESTL1 \rightarrow $* $L1 \vert $? $L1 \vert $+ $L1 \vert \epsilon $\\
$L1TAIL \rightarrow "\vert"$ $L$ $L1TAIL \vert \epsilon$\\
$L2TAIL \rightarrow L$ $L2TAIL \vert \epsilon$\\
$REPLACE \rightarrow $REPLACE$(CHARARG, CHARARG)$ \\
$FOR \rightarrow $for$(INTEGER){SERIES}$\\
$WHILE \rightarrow $while$(RE){SERIES}$\\
$INSERT \rightarrow $INSERT$(Y, CHAR)$ \\
$PRINT \rightarrow $PRINT$(PRINTARG)$ \\
$SUBSTRING \rightarrow $SUBSTRING$(NUM, Y)$ \\
$Y \rightarrow NUM\vert $EOL \\
$NUM \rightarrow DIGIT \vert DIGIT$ $NUM$ \\
$DIGIT \rightarrow 0 \vert 1 \vert 2 \vert 3 \vert 4 \vert 5 \vert 6 \vert 7
\vert 8 \vert 9$ \\
$PRINTARG \rightarrow "STRING" \vert LINE$\\ 
$CHARARG \rightarrow $a$\vert$b$\vert$c\\
$STRING \rightarrow CHAR \vert CHAR $ $ STRING $\\
$CHAR \rightarrow $A$ \vert $B$ \vert $C$ \vert $D$ \vert $E$ \vert $F$ \vert $G$ \vert $H$ \vert $I$ \vert $J$ \vert $K$ \vert $L$ \vert $M$ \vert $N$ \vert $O$ \vert $P$ \vert $Q$ \vert $R$ \vert $S$ \vert $T$ \vert $U$ \vert $V$ \vert $W$ \vert $X$ \vert $Y$ \vert $ \\
a$ \vert $b$ \vert $c$ \vert $d$ \vert $e$ \vert $f$ \vert $g$ \vert $h$ \vert $i$ \vert $j$ \vert $k$ \vert $l$ \vert $m$ \vert $n$ \vert $o$ \vert $p$ \vert $q$ \vert $r$ \vert $s$ \vert $t$ \vert $u$ \vert $v$ \vert $w$ \vert $x$ \vert $y \\
\end{quote}
\end{document}
